package com.sdleyou.treepro.business.api.achievement;

import com.sdleyou.treepro.common.model.utils.ResultVOUtil;
import com.sdleyou.treepro.common.model.vo.ResultVO;
import com.sdleyou.treepro.common.service.AchievementManager;
import com.sdleyou.treepro.common.service.CardManager;
import com.sdleyou.treepro.common.service.UserAchievementManager;
import com.sdleyou.treepro.system.version.ApiVersion;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.validation.constraints.NotEmpty;
import java.math.BigDecimal;

/**
 * 成就控制器
 */
@RestController
@RequestMapping("/api")
public class AchievementController {

    @Autowired
    private CardManager cardManager;
    @Autowired
    private UserAchievementManager userAchievementManager;

    /**
     * 获取成就信息
     */
    @ApiVersion(1)
    @PostMapping("/{version}/achievement/info")
    public ResultVO achievementInfo(@RequestParam(name = "user_id") @NotEmpty(message = "用户id不能为空") String userId){
        return ResultVOUtil.success(userAchievementManager.achievementInfo(userId));
    }
}
